package com.wang.service.impl;


import com.alibaba.dubbo.config.annotation.Service;
import com.wang.dao.IMemberDAO;
import com.wang.service.IMemberService;
import com.wang.vo.Member;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.Map;

@Service
public class MemberServiceImpl implements IMemberService {

    @Autowired
    private IMemberDAO memberDAO;

    @Override
    public Member get(String mid) {
        return this.memberDAO.findById(mid);
    }

    @Override
    public Map<String, Object> login(String mid, String password) {
        Map<String, Object> map = new HashMap<String, Object>();
        Member member = this.memberDAO.findById(mid);
        if (member == null) {    // 用户不存在
            return map;
        }
        map.put("name", member.getName());
        return map;
    }

}
